def cli = new CliBuilder()
cli.with {
usage: 'foobar'
  h longOpt:'help', 'this information'
  i longOpt:'input', 'input file containing similarity values',args:1, required:true
  c longOpt:'col', 'column to use (vals 1..4)', args:1, required:true
  //  t longOpt:'threads', 'number of threads', args:1
  //  k longOpt:'stepsize', 'steps before splitting jobs', arg:1
}

def opt = cli.parse(args)
if( !opt ) {
  //  cli.usage()
  return
}
if( opt.h ) {
  cli.usage()
    return
}


def col = new Integer(opt.c)

def f = new File(opt.i)

def l = []
f.splitEachLine("\t") { line ->
  //  println line
  def v = new Double(line[col])
  l<<v
}
l = l.sort()
def tot = l.size()
for (int i = 0 ; i < l.size() ; i++) {
  def d = i/tot
  println l[i]+"\t$d"
}
println "1\t1"
